package daily;

/**
 * @Date 2024-03-05
 * @Author Jonathan
 */
public class StaticTest {
    public static int temp = 2;
//    public static StaticTest instance = new StaticTest();

    static {
        System.out.println("静态代码块" + temp);
    }

    {
        System.out.println("非静态代码块");
    }

    public StaticTest() {
        System.out.println("构造方法");
//        method();
    }

    public void method() {
        System.out.println("普通成员方法");
    }

    @Override
    public String toString() {
        return "toString StaticTest";
    }

    public static void main(String[] args) {
        new StaticTest();
        System.out.println("----------------");
        new StaticTest();
    }

}
